﻿using System;
using System.Data.SqlClient;

public class DBConnection
{
    private static string Database = "studentSubsidy";
    private static string Username = "sa";
    private static string Password = "123456";
    private static string Server = "LEETYPC\\SQLEXPRESS01";


    // private ISessionFactory _sessionFactory;
    private string ConnectString = "server="+Server+";database=studentSubsidy;uid=" + Username + ";pwd=" + Password;
    private SqlConnection SqlConnection;

    public DBConnection()
    {
        SqlConnection = new SqlConnection(ConnectString);
    }

    public SqlConnection GetConnection()
    {
        SqlConnection.Open();
        return SqlConnection;
    }

    public void Close(SqlConnection connection)
    {
        connection.Close();
    }
}